package base.engine;

import java.util.ArrayList;

import base.common.IHandler;
import base.common.IInput;

public class InputHandler implements IHandler
{
	//TODO Create IInput mapping to inputs
	//TODO Solve termination. TEMP FIX: Replace inputManager with new instance

	private ArrayList<IInput> inputList = new ArrayList<IInput>();

	@Override
	public void initiate() {}

	@Override
	public void update()
	{
		for (IInput iinput : inputList)
		{
			iinput.onInputUpdate();
		}
	}

	@Override
	public void terminate()
	{
		this.inputList.clear();
	}

	/**Register IInput*/
	public void registerInput(IInput par1IInput)
	{
		inputList.add(par1IInput);
	}
}
